﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Ycm20250401.Service._20250522.Domain.Entities
{
    public class GoodsOrderModel
    {
        public string OrderNo { get; private set; }

        public string CarNumber { get; private set; }

        /// <summary>
        /// 毛重
        /// </summary>
        public decimal GrossWeight { get; private set; }
        /// <summary>
        /// 净重
        /// </summary>
        public decimal NetWeight { get; private set; }

        public decimal GoodsWeight { get; private set; }

        public GoodsClass GoodsInfo { get; private set; }

        //入库时间
        public DateTime InboundTime { get; private set; }
        //出库时间
        public DateTime OutboundTime { get; private set; }

        public int State { get; private set; }

        //入库人
        public string InboundPerson { get; private set; }
        //出库人
        public string OutboundPerson { get; private set; }

        public GoodsOrderModel(string orderNo)
        {
            OrderNo = orderNo;
          
        }

        public void Inbound(string carNumber,decimal grossWeight, GoodsClass goodsInfo,string inboundPerson)
        {
            CarNumber = carNumber;
            GrossWeight = grossWeight;
            GoodsInfo = goodsInfo;
            State = 0;
            InboundTime=DateTime.Now;
            InboundPerson = inboundPerson;
        }

        public void Outbound(decimal netWeight, string outboundPerson)
        {
            NetWeight = netWeight;
            State = 1;
            GoodsWeight = GrossWeight- NetWeight;
            OutboundTime = DateTime.Now;
            OutboundPerson = outboundPerson;
        }
    }
}
